<template>
  <div class="home">
    <el-tabs v-model="tabIndex" type="card">
      <el-tab-pane label="上传文件" name="upload">
        <el-upload action="/upload" drag multiple auto-upload>
          <i class="el-icon-upload"></i>
          <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        </el-upload>
      </el-tab-pane>
      <el-tab-pane ref="fileViewer" label="浏览文件" name="fileViewer">
        <file-viewer :refresher.sync="tabIndex" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import fileViewer from "@/components/fileViewer";
export default {
  name: "Home",
  data() {
    return {
      tabIndex: "upload",
    };
  },
  components: {
    fileViewer,
  },
};
</script>
